'use strict';
import * as Koa from 'koa';
import { router, prefix } from '../middleware/router';
import { response } from '../middleware/result';
import { mealService } from '../service/meal';

/** 餐币api对象 */
@prefix('meal')
class MealController {
    /**
     * 
     * @api {post} /meal/query  查询餐币消费明细
     * @apiDescription 查询酒币消费明细
     * @apiName query
     * @apiParam (参数) {String} offset   页码
     * @apiParam (参数) {String} limit    每页显示条数
     * @apiParam (参数) {String} token  用户标识token
     * @apiSampleRequest /meal/query
     * @apiGroup meal
     * @apiVersion 1.0.0
     */
    @router('/query')
    async query(ctx: Koa.Context) {
        let result = await mealService.query(ctx.request.body);
        response(ctx, result);
    }
}